FROM archlinux:latest

LABEL maintainer="Zheng Qijun <zhengqijun0121@qq.com>"

RUN echo -e '[archlinuxcn]\nSigLevel = Never\nInclude = /etc/pacman.d/cnmirrorlist' >> /etc/pacman.conf && \
    echo -e 'Server = https://mirrors.tuna.tsinghua.edu.cn/$repo/$arch' >> /etc/pacman.d/cnmirrorlist && \
    pacman -Syy --noconfirm && pacman -S --noconfirm xfce4 xfce4-goodies tigervnc fontconfig vim git tig \
        make gcc alacritty noto-fonts-emoji pkg-config openssh net-tools htop which neofetch fzf tmux \
        ranger python python-pip base-devel tmux ranger neovim tzdata the_silver_searcher yay && \
    pacman -Scc --noconfirm && \
    echo 'root:111111' | chpasswd && \
    mkdir ~/.vnc && echo '111111' | vncpasswd -f > ~/.vnc/passwd && \
    echo 'session=xfce4' > ~/.vnc/config && \
    mkdir -p /usr/share/xsessions && \
    echo -e '[Desktop Entry]\n' \
            'Encoding=UTF-8\n' \
            'Name=Xfce4\n' \
            'Comment=Xfce4 Desktop Environment\n' \
            'Exec=startxfce4\n' \
            'Icon=xfce4\n' \
            'Type=XSession' > /usr/share/xsessions/xfce4.desktop && \
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    git config --global user.name 'zhengqijun' && \
    git config --global user.email 'zhengqijun0121@qq.com' && \
    git clone https://gitee.com/zhengqijun/fonts && \
    mkdir ~/.local/fonts && cp -rf ~/fonts/fonts ~/.local/share/ && cd ~/.local/share/fonts && fc-cache -fv

ENV TERM xterm-256color
ENV SHELL /bin/bash
ENV HOME /root
ENV USER root
ENV USERNAME root

WORKDIR $HOME

# ENTRYPOINT ["/bin/bash"]

EXPOSE 5921

CMD ["/usr/sbin/vncserver", ":21"]

# EOF

